package com.xbongbong.parent.interfaces;

import com.xbongbong.paas.domain.entity.PaasFormDataEntity;
import com.xbongbong.paas.domain.entity.ext.PaasFormEntityExt;
import com.xbongbong.paas.pojo.dto.FormDataAddDTO;
import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.pro.formdata.pojo.vo.BeforeSaveVO;
import com.xbongbong.pro.formdata.pojo.vo.SaveVO;

/**
 *
 * 新建之后的操作，如：保存团队，关联产品，联系人，业务规则，api回调，低代码等
 * @author 吴峰
 * @date 2021/12/28 16:11
 */
public interface BusinessAddAfterService<F, D> {



    /**
     * 插入后保存日志
     * @param formDataAddDTO
     * @param paasFormEntity
     * @param newPaasFormDataEntity
     * @param saveVO
     * @param beforeSaveVO
     * @throws XbbException
     */
    void afterSaveLog(FormDataAddDTO formDataAddDTO, F paasFormEntity, D newPaasFormDataEntity, SaveVO saveVO, BeforeSaveVO beforeSaveVO) throws XbbException;

    /**
     * 发起 api
     * @param formDataAddDTO
     * @param saveVO
     * @param beforeSaveVO
     * @return void
     * @author 吴峰
     * @date 2021/3/18 20:20
     * @throws XbbException
     */
    void apiHook(FormDataAddDTO formDataAddDTO, SaveVO saveVO, BeforeSaveVO beforeSaveVO) throws XbbException;



    /**
     * 低代码执行服务
     * @param formDataAddDTO
     * @param saveVO
     * @param beforeSaveVO
     * @throws XbbException
     */
    void lowCodeExecuteService(FormDataAddDTO formDataAddDTO, SaveVO saveVO, BeforeSaveVO beforeSaveVO) throws XbbException;

    /**
     * 执行业务规则
     * @param formDataAddDTO
     * @param beforeSaveVO
     * @param newPaasFormDataEntity 数据实体
     * @param paasFormEntityExt 表单实体
     * @throws XbbException
     */
    void activeRule(FormDataAddDTO formDataAddDTO, BeforeSaveVO beforeSaveVO, PaasFormDataEntity newPaasFormDataEntity, PaasFormEntityExt paasFormEntityExt) throws XbbException;
}
